package cn.elves.model.provider;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "uua-service")
public interface AuthTokenProvider {

    @PostMapping("oauth/token")
    public String createAuthToken(@RequestParam(name = "grant_type")String grantType,
                                  @RequestParam(name = "client_id")String clientId,
                                  @RequestParam(name = "client_secret")String clientSecret,
                                  @RequestParam(name = "redirect_uri")String redirectUri,
                                  @RequestParam(name = "scope")String scope,
                                  @RequestParam(name = "username")String username,
                                  @RequestParam(name = "password")String password);


    @GetMapping("/invalidate/token")
    public String invalidateAuthToken(@RequestParam(name = "accessToken")String accessToken);

    @PostMapping("/oauth/check_token")
    public String checkToken(@RequestParam(name = "token")String token);
}
